﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApp19.One
{
    public class Context
    {
        public State State { get; set; }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="state">默认Context的初始状态</param>
        public Context(State state)
        {
            this.State = state;
        }

        /// <summary>
        /// 对亲求做处理，并设置下一状态
        /// </summary>
        public void Request()
        {
            State.Handle(this);
        }
    }
}
